package com.poster.constant;


import jakarta.annotation.PostConstruct;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


import java.time.ZoneId;

@Slf4j
@Data
@Component
public class AppConfig {


    @Value("${app.timezone}")
    private String zoneId;

    @Value("${app.jwt.secret}")
    private String jwtSecret;

    @Value("${app.jwt.algorithm}")
    private String jwtAlgorithm;

    @PostConstruct
    public void init() {

        if (zoneId == null){
            log.warn("未配置时区将使用默认系统时区{}", ZoneId.systemDefault().getId());
            zoneId = ZoneId.systemDefault().getId();
        }

    }


}
